<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script src="${pageContext.request.contextPath}/dwz/js/dwz.regional.zh.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/dwz/js/dwz.validate.method.js" type="text/javascript"></script>
<div class="pageContent">
	<form action="insideUser_${empty isuId ? "
		add":"edit" }.action"
		class="pageForm required-validate"
		onsubmit="return validateCallback(this, navTabAjaxDone);"
		method="post">
		<input type="hidden" name="isuId" value="${isuId }">
		<div class="pageFormContent nowrap" layoutH="56">
			<dl>
				<dt>
					<label>用户组：</label>
				</dt>
				<dd>
					<select name="isuGroupCode" 
						class="required combox"
						ref="${empty isuId ? "add":"edit" }_roleList"
						refUrl="userRole_getRoleList2.action?usgCode={value}">
						<option value="">---请选择---</option>
						<c:forEach items="${userGroupList}" var="group">
							<option ${isuGroupCode==group.usgCode?"selected":""}  value="${group.usgCode }">${group.usgName}</option>
						</c:forEach>
					</select>
				</dd>
			</dl>
			<dl>
				<dt>
					<label>角色：</label>
				</dt>
				<dd>
					<select name="isuRoleCode" id="${empty isuId ? "add":"edit" }_roleList" class="required combox" onchange="role_change()">
						<option value="" >---请选择---</option>
						<c:forEach items="${userRoleListByGroup }" var="role">
							<option ${isuRoleCode==role.usrCode?"selected":""} value="${role.usrCode}">${role.usrName}</option>
						</c:forEach>
					</select>
				</dd>
			</dl>
			<dl id="managerFlag" style="display:none;">
				<dt>
					<label>是否大区经理：</label>
				</dt>
				<dd>
					<select name="managerFlag" id="${empty isuId ? "add":"edit" }_managerFlag" class="combox" >
						<option value="" >---请选择---</option>
						<option ${managerFlag=="0"?"selected":""} value="0">否</option>
						<option ${managerFlag=="1"?"selected":""} value="1">是</option>
					</select>
				</dd>
			</dl>
			<dl>
				<dt>
					<label>部门：</label>
				</dt>
				<dd>
					<select name="deptCode" id="groupId3"
						class="required combox">
						<option value="">---请选择---</option>
						<c:forEach items="${departmentList}" var="dept">
							<option ${deptCode==dept.deptCode?"selected":""} value="${dept.deptCode}">${dept.deptName}</option>
						</c:forEach>
					</select>
				</dd>

			</dl>
			<dl>
				<dt>
					<label>姓名：</label>
				</dt>
				<dd>
					<input name="isuName" class="required" type="text"
						maxlength="20" value="${isuName}" />
				</dd>

			</dl>
			<dl>
				<dt>
					<label>性别：</label>
				</dt>
				<dd>
					<select name="isuSex" class="required combox">
						<option ${isuSex==0?"selected":"" } value="0">---请选择---</option>
						<option ${isuSex==1?"selected":"" } value="1" >男</option>
						<option ${isuSex==2?"selected":"" } value="2">女</option>
					</select>
				</dd>
			</dl>
			<dl>
				<dt>
					<label>手机号：</label>
				</dt>
				<dd>
					<input type="text" name="isuPhone" maxlength="11"
						class="required mobile" value="${isuPhone}"
						remote="insideUser_checkPhoneForAdd.action"
						 />
				</dd>
			</dl>
			<dl>
				<dt>
					<label>手机串号：</label>
				</dt>
				<dd>
					<input type="text" name="isuIMEI" maxlength="20" value="${isuIMEI}" />
				</dd>
			</dl>
			<dl>
				<dt>
					<label>电子邮件：</label>
				</dt>
				<dd>
					<input type="text" name="isuEmail" maxlength="60"
						class="required email" value="${isuEmail}"/>
				</dd>
			</dl>

			<dl>
				<dt>
					<label>备注信息：</label>
				</dt>
				<dd>
					<textarea name="remark" rows="2" cols="30">${remark}</textarea>
				</dd>
			</dl>

		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
		<input type="hidden" value="${csrfToken}" name="CSRFToken">
	</form>
</div>
<script type="text/javascript">
	function role_change(){
		var roleCode_add=document.getElementById("add_roleList").value;
		if(roleCode_add=="1102"){
			document.getElementById("managerFlag").style.display="block";
		}else{
			document.getElementById("managerFlag").style.display="none";
		}
	}
</script>